package com.niiwoo.civet.account.dao.mapper;

import com.niiwoo.civet.account.dao.entity.WithdrawOrder;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

public interface WithdrawOrderMapperExt extends WithdrawOrderMapper {

    /**
     * 查询应垫资总额
     *
     * @return
     */
    BigDecimal queryAdvanceAmountTotal(@Param("userId") String userId);

    /**
     * 锁行查询
     *
     * @param id
     * @return
     */
    WithdrawOrder selectByPrimaryKeyForUpdate(Long id);

    /**
     * 根据流水号查询订单
     * @param requestNo
     * @return
     */
    WithdrawOrder queryWithdrawOrderByRequestNo(@Param("requestNo") String requestNo);

    /**
     * 查询最近一次提现记录
     * @param userId
     * @return
     */
    WithdrawOrder selectLastWithdrawSuccessRecord(String userId);
}